{% extends "base.html" %}

{% block stylesheet %}
    <style type="text/css">
    div.qna div.content .q {
        width: 370px;
        float: left;
    }
    div.qna div.content .a {
        width: 540px;
        float: left;
        margin-left: 14px;
    }
    div.qna div.content .private {
        display: none;
    }
    </style>
{% endblock %}

{% block note %}
            <p>这里是所有的问答条目，提问时间越晚的条目越靠上。</p>
{% endblock %}

{% block header_extra %}{% endblock %}

{% block main %}
            <div class="column-4-unit">
                <div class="list qna">
                    <h2>所有问答 <label>只显示精选问答<input id="checkbox_selectedonly" type="checkbox" /></label> <label>显示非公开问答<input type="checkbox" id="checkbox_private" /></label></h2>
                    <div class="content">
                        <ul>
                            {% load short %}
                            {% for q in qs %}
                            {% if q.publicall %}
                            <li{% if q.a.selected %} class="selected"{% endif %}>
                                <div class="q">
                                    <h3><a href="/view/{{ q.id }}/"><span class="who">{{ q.writername }} 问：</span><span class="what">{{ q.title }} <span class="id">#{{ q.id }}</span></span></a></h3>
                                    <p><a href="/view/{{ q.id }}/">{{ q.content|short:115 }}</a></p>
                                </div>
                                <div class="a">
                                {% if q.a %}
                                    <h3><a href="/view/{{ q.id }}/"><span class="who">{{ q.a.writer }} 答：</span></a></h3>
                                    <p><a href="/view/{{ q.id }}/">{{ q.a.content|short:175 }}</a></p>
                                {% endif %}
                                </div>
                                <br class="clear" />
                            </li>
                            {% else %}
                            <li class="private">
                                <div class="q">
                                    <h3><a href="/view/{{ q.id }}/"><span class="who">匿名 问：</span><span class="what">非公开问题 <span class="id">#{{ q.id }}</span></span></a></h3>
                                </div>
                                <br class="clear" />
                            </li>
                            {% endif %}
                            {% endfor %}
                        </ul>
                    </div>
                </div>
            </div>
{% endblock %}
